package com.hxkj.dao.impl;

import com.hxkj.dao.ArticleDao;
import com.hxkj.domain.po.Column;
import com.hxkj.domain.po.Tags;
import com.hxkj.mapper.ArticleMapper;
import com.hxkj.domain.po.Article;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;


/**
* 数据操作实现
*
* @author: zzx
* @version: 1.0
* @datetime: 2018-06-05 17:57:34
*
*/
@Service("articleDao")
public class ArticleDaoImpl implements ArticleDao {

    @Resource
    private ArticleMapper articleMapper;

    @Override
    public Article get(Long articleId) {
        return articleMapper.selectByPrimaryKey(articleId);
    }

    @Override
    public List<Article> get(Article article) {
        return articleMapper.select(article);
    }

    @Override
    public List<Article> getArticleList(Article article) {
        return articleMapper.getArticleList(article);
    }

    @Override
    public List<Article> getArticleListByTags(Article article) {
        return articleMapper.getArticleListByTags(article);
    }

    @Override
    public List<Article> getArticleHeadline(Article article) {
        return articleMapper.getArticleHeadline(article);
    }

    @Override
    public int delete(Long articleId) {
        return articleMapper.deleteByPrimaryKey(articleId);
    }

    @Override
    public int delete(Article article) {
        return articleMapper.delete(article);
    }

    @Override
    public int save(Article article) {
        return articleMapper.insert(article);
    }

    @Override
    public int update(Article article) {
        return articleMapper.update(article);
    }

    @Override
    public List<Article> getArticleByColumnId(Article article) {
        return articleMapper.getArticleByColumnId(article);
    }

    @Override
    public Article getArticleByHeat() {
        return articleMapper.getArticleByHeat();
    }

    @Override
    public List<Article> getArticle1(Article article) {
        return articleMapper.selectArticle1(article);
    }

    @Override
    public List<Article> getArticle3(Article article) {
        return articleMapper.selectArticle3(article);
    }

    @Override
    public List<Article> getArticle4(Article article) {
        return articleMapper.getArticle4(article);
    }

    @Override
    public List<Article> getArticleMarket(Article article) {
        return articleMapper.selectArticleMarket(article);
    }

    @Override
    public List<Article> getHotArticle(Article article) {
        return articleMapper.selectHotArticle(article);
    }

    @Override
    public List<Article> getOptionArticleList(Article article) {
        return articleMapper.getOptionArticleList(article);
    }


    @Override
    public List<Article> getArticleListByLocationLevel(Article article) {
        return articleMapper.getArticleListByLocationLevel(article);
    }

    @Override
    public Article getPreArticle(Article article) {
        return articleMapper.getPreArticle(article);
}

    @Override
    public Article getNextArticle(Article article) {
        return articleMapper.getNextArticle(article);
    }

    @Override
    public List<Article> getColumnArticleList(Article article) {
        return articleMapper.getColumnArticleList(article);
    }

    @Override
    public int updateArticleRecover(Article article) {
        return articleMapper.updateArticleRecover(article);
    }

    @Override
    public int updateArticleStick(Article article) {
        return articleMapper.updateArticleStick(article);
    }

    @Override
    public List<Article> getArticleListByParam(Article article) {
        return articleMapper.getArticleListByParam(article);
    }

    @Override
    public List<Tags> getHotArticleAsTagsList(Article article) {
        return articleMapper.getHotArticleAsTagsList(article);
    }

    @Override
    public Integer getRightsCount(Article article) {
        return articleMapper.getRightsCount(article);
    }

    @Override
    public List<Article> getrightsArticlesByParam(Article article) {
        return articleMapper.getrightsArticlesByParam(article);
    }

    @Override
    public int modifyHeat(Article article) {
        return articleMapper.modifyHeat(article);
    }

    @Override
    public List<Article> searchArticle(Article article) {
        return articleMapper.searchArticle(article);
    }

    @Override
    public List<Article> getArticleListByTime(Article article) {
        return articleMapper.getArticleListByTime(article);
    }

    @Override
    public List<Article> getArticleByTempletId(Article article) {
        return articleMapper.getArticleByTempletId(article);
    }

    @Override
    public int modifyArticleAsPath(Article article) {
        return articleMapper.modifyArticleAsPath(article);
    }

    @Override
    public List<Article> getArticleInMonth(Article article) {
        return articleMapper.getArticleInMonth(article);
    }

    @Override
    public List<Article> getRandomArticle(Article article) {
        return articleMapper.getRandomArticle(article);
    }

    @Override
    public List<Article> getCorrelationArticle(Article article) {
        return articleMapper.getCorrelationArticle(article);
    }

    @Override
    public List<Article> getDailyArticleList(Article article) {
        return articleMapper.getDailyArticleList(article);
    }

    @Override
    public List<Article> getWeeklyArticleList(Article article) {
        return articleMapper.getWeeklyArticleList(article);
    }


    /**
     * 根据用户中心的需求查询所有站点热度最高的十篇文章
     * @return
     */
    public List<Article> selectArticleForUserCenter(){
        return articleMapper.selectArticleForUserCenter();
    }

    @Override
    public List<Article> getAllArticleList(Article article) {
        return articleMapper.getAllArticleList(article);
    }

    @Override
    public List<Article> getRecommendationArticle(Article article) {
       return articleMapper.getRecommendationArticle(article);
    }

    @Override
    public List<Article> getArticleByIds(Article article) {
        return articleMapper.getArticleByIds(article);
    }
}
